package rule03;

/**
 * final 不允许被继承
 * @author ChangLiang
 * @date 2020/3/16
 */
public final class SingletonObject1 {

    //
    private byte[] data = new byte[1024];

    // 在定义实例对象的时候直接初始化
    private static final SingletonObject1 instance = new SingletonObject1();

    private SingletonObject1() {

    }

    public static SingletonObject1 getInstance() {
        return instance;
    }
}
